package com.szqhyxj.youxiangju.biz.partnerHome.my;

import com.szqhyxj.youxiangju.biz.core.UserInfoManger;
import com.szqhyxj.youxiangju.biz.merchantHome.my.MyContract;
import com.szqhyxj.youxiangju.biz.merchantHome.my.MyModel;

import java.util.List;

public class PartnerMyPresenter implements PartnerMyContract.Presenter {

    private PartnerMyContract.View view;

    PartnerMyPresenter(PartnerMyContract.View view) {
        this.view = view;
    }

    @Override
    public void init() {
        List<PartnerMyModel.IconItem> iconItems = PartnerMyModel.getIconItems();
        view.showMyFuncItems(iconItems);
        view.showUserInfo(UserInfoManger.INSTANCE.getUser());
        if (UserInfoManger.INSTANCE.getUser().getUserType() == 5 || UserInfoManger.INSTANCE.getUser().getUserType() == 4) {
            view.showPartner();
            view.showShape();
            view.showGoMerchant();

        } else {
            view.enshowPartner();
            view.enshowShape();
            view.enshowCertification();

        }
        if (UserInfoManger.INSTANCE.getUser().getRealNameAuthStatus() == 0) {
            view.showCertification();
        }
        if (UserInfoManger.INSTANCE.getUser().getRealNameAuthStatus() == 1) {
            view.enshowCertification();
        }

        view.showBalance(UserInfoManger.INSTANCE.getUser().getBalance() + "");
    }


}